#include <iostream>
using namespace std;
class Move{
	private:
		double x;
		double y;
	public:
		Move(double a=0,double b=0)//sets x,y to a,b
		{
			this->x=a;
			this->y=b;
		}
		void showMove()const;//shows current x,y values
		Move add(const Move &m)const;//this funcion adds x of m to x of invoking object to get new x,adds y of m to y of invoking object to get new y,creates a new Move object initialized to new x,y values and returns it
		void reset(double a=0,double b=0);//resets x,y to a,b
};


int main()
{
	double x,y;
	Move M1;
	M1.showMove();
	cin>>x;
	cin.get();
	cin>>y;
	Move M2(x,y);
	M2.showMove();
	M1=M2.add(M1);
	M1.showMove();
	M2.reset();
	M2.showMove();
	return 0;
}


void Move::showMove()const{
	cout<<this->x<<','<<this->y<<endl;
}
Move Move::add(const Move &m)const{
	Move New;
	New.x=this->x+m.x;
	New.y=this->y+m.y;	
	return New;
}
void Move::reset(double a,double b){
	x=a;
	y=b;
}
